<%--
 *  File:    zylContactSummary.jsp
 *  @Author: zahirzhong
 *  Date:    2012/09/25
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="http://dcms.oval.com/page/dcms" prefix="dcms" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.zylContactSummary"); 

  //init param
  String strModuleName = "ORM";
  String privilegeCode = "10104";
  String contextPath = request.getContextPath();
  String strTableName = "v_contactsummary";
 
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>
<html>
<head>
<title>DoctorSummary</title>
<PageFlow:CheckPageFlow pageName="p_zylcontactsummary"/>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/summary.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/NewCalendar.inc" %>
<%
HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
Integer employeeid=(Integer)CurUserInfo.get("userid");
%>
<script>
window.onload=function(){ 
	var objdeptcode=eval("__otherSearchConditionForm.deptid");
	if (objdeptcode==""){
	    return;
	}
	var  datahandler = new  DataHandler() ;
	datahandler.add_params("maxitem" , 1000 , "Integer");
	datahandler.add_params("deptid" , objdeptcode.value , "String");
	datahandler.getResultFromVector("deptsummary","deptname" ,"deptid" ,"__otherSearchConditionForm.deptid") ;
	datahandler.add_job("getdeptsummary") ;
	datahandler.runDataHandler();
};

function export_info(){
    var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	//var val = obj.options[index].text;
	var url="";
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
    //window.open("<%= reportURL %>/servlet/ExcecuteReport/linkmansummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&deptid="+$("select[name='deptid']").find("option:selected").val()+"&stdareaid="+$('input[name=stdareaid]').val()+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
    url="<%=newreportURL %>/xlsrpt?reportname=linkmansummary&globalpccode=112&employeeid="+<%=employeeid %>+"&deptid="+$("select[name='deptid']").find("option:selected").val()+"&stdareaid="+$('input[name=stdareaid]').val()+'&'+__searchname+'='+escape(encodeURI(__searchvalue));
    url=url+"&timestamp="+Date.parse(new Date())+"&datacategoryval=17";
    DataReport(url);    
}

function page_popBusinessarea()
{
	if(popwindow!=null)
  popwindow.close();
  popwindow = window.open("zylstdbusinessareapop.jsp?nostatus=1&<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>","newwindow", "height=300, width=800,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
	
}

function setContact(id,type,name){
	$('input[name=stdareaid]').val(id);
	$('input[name=areaname]').val(name)
}
/* function setdeptId(){
	alert($("select[name='alldepts']").find("option:selected").val());
	$('input[name=deptid]').val($("select[name='alldepts']").find("option:selected").val());
} */

function page_clear(){
	__otherSearchConditionForm.stdareaid.value="";
	__otherSearchConditionForm.areaname.value="";
	__otherSearchConditionForm.deptid.value="";
}
</script>

</head>
<body>
<% 
  String str1 = label.getLabelName("L_BasicInfo");
String str2 = label.getLabelName("L_JobInfo");
  String str4 = label.getLabelName("L_Kinship");
 
%>
<dcms:summary id="ogm.zylreportlinkmansummary"  needNew="true" newTabID="mainTab" editTabID="mainTab" needEdit="true" >
	<dcms:param name="employeeid" property="session:userinfo.userid"/>
	<dcms:param name="pivotins" property="pivotinfo.pivotins"/>
	<dcms:summaryTab id="mainTab" name="<%=str1%>"  href="/masterdata/ogm/zylContactEdit.jsp"/>
	<dcms:summaryTab id="jobTab" name="<%=str2%>"  href="/masterdata/ogm/zylContactJob.jsp"/>
	<dcms:summaryTab id="relationTab" name="<%=str4%>"  href="/phap/masterdata/erm/RelationInfoLinkMan.jsp"/>
	<dcms:summaryAction actionFuction="__export('XLSX')" labelCode="L_ALL_Execcd" styleWidth="70" privilegeCode="MB-LXR03"/>
    <dcms:summaryAction actionFuction="export_info" labelCode="L_Upload_Derived" styleWidth="77" privilegeCode="MB-LXR04"/>
    <dcms:otherSearchCondition>
  	 <iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
     <table width="100%" cellspacing="0" cellpadding="0" border="0">
     	    <tr style="text-align:left">
     	      <td style="text-align:left"><%= label.getLabelName("L_Dept") + label.getLabelName("L_Colon") %>
              <custom:select optionInnerTextKey="deptname" property="deptid"  optionsName="deptsummary" optionValueKey="deptid" label="L_DefaultDeptName" defaultValue="------" defaultValueCost=""/>
              </td>
			</tr>
			<tr style="text-align:left" ><td class="text-align:left"><%=label.getLabelName("L_Province") +  label.getLabelName("L_Colon") %>
				<custom:hidden property="stdareaid" />
		        <custom:text property="areaname" />
		        <a onclick="page_popBusinessarea();"><custom:button type="3" value="*"/></a>
		        </td>
		        <!-- <td><button type="button" onclick="page_clear()" class="button1" name="re" value="clear" style="width:60"><%=label.getLabelName("L_Clear") %></button></td> -->
			</tr>
			
        </table>
  </dcms:otherSearchCondition>  
</dcms:summary>
</body>
<script>
  document.getElementById("__searchvalue").onkeydown=function seachKeyDown()
  {
   // alert(event.keyCode);
    if(event.keyCode==13)
    {
      __summaryGo(document.getElementById("__summaryConfigID").value,document.getElementById("__indicatorImagePath").value,document.getElementById("__summaryRootPath").value,'');
    }
  }
</script> 
</html>